using OracleInternal.SqlAndPlsqlParser.LocalParsing;

namespace OracleInternal.SqlAndPlsqlParser.RuleProcessors.ODPCommands
{
	internal static class OracleMbEarleyBlockStmtRuleMultiProcessors
	{
		public static OracleMbEarleyRuleMultiProcessorAddItem[] s_vRuleProcessorItems;

		static OracleMbEarleyBlockStmtRuleMultiProcessors()
		{
			OracleMbEarleyRuleMultiProcessorAddItem[] array = new OracleMbEarleyRuleMultiProcessorAddItem[3];
			OracleMbEarleyRuleMultiProcessorAddItem oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "block_stmt",
				m_vRHSSymbols = new string[1]
				{
					"DECLARE_decls_opt"
				},
				m_vRuleProcessor = Process_BlockStmt_StaticDmlStmt_DECLAREDeclsOpt_StartWithRule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.AllRulesStartingWith
			};
			array[0] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "block_stmt",
				m_vRHSSymbols = new string[1]
				{
					"seq_of_stmts"
				},
				m_vRuleProcessor = Process_BlockStmt_SeqOfStmts_PartialRule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.AllPartialMatchingRules
			};
			array[1] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "block_stmt",
				m_vRHSSymbols = new string[1]
				{
					"exception_handlers_opt"
				},
				m_vRuleProcessor = Process_BlockStmt_ExceptionHandlersOpt_PartialRule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.AllPartialMatchingRules
			};
			array[2] = oracleMbEarleyRuleMultiProcessorAddItem;
			s_vRuleProcessorItems = array;
		}

		public static object Process_BlockStmt_StaticDmlStmt_DECLAREDeclsOpt_StartWithRule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			((OracleLpParserContext)ctx).CurrentStatementClause = OracleLpStatementClauseType.Declare;
			((OracleLpParserContext)ctx).HandleBindVariables = true;
			return OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode.Children()[ruleMatchPosition], ctx.CurrentRuleIndex + 1, -1, ctx);
		}

		public static object Process_BlockStmt_SeqOfStmts_PartialRule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			((OracleLpParserContext)ctx).CurrentStatementClause = OracleLpStatementClauseType.SequenceOfStatements;
			((OracleLpParserContext)ctx).HandleBindVariables = true;
			return OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode.Children()[ruleMatchPosition], ctx.CurrentRuleIndex + 1, -1, ctx);
		}

		public static object Process_BlockStmt_ExceptionHandlersOpt_PartialRule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			((OracleLpParserContext)ctx).CurrentStatementClause = OracleLpStatementClauseType.ExceptionHandlers;
			((OracleLpParserContext)ctx).HandleBindVariables = true;
			return OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode.Children()[ruleMatchPosition], ctx.CurrentRuleIndex + 1, -1, ctx);
		}
	}
}
